The present invention relates to user interfaces and more particularly to a method and system for allowing a developer to lay out a window that can be resized in a more flexible fashion.
A window that an end user sees is typically composed of controls. These controls include input fields, labels, drop down lists, buttons, text areas, and other items that an end user may see in a window. The window is typically developed in a multi-step process. A window is first laid out by a developer. The corresponding code is then generated. This corresponding code creates the window provided to the end user.
A developer typically lays out the window by utilizing a conventional form designer. The form designer is a tool used to allow a developer to graphically lay out the controls in the window. A form designer is also known as a dialog editor or a form editor. Once the window is laid out, the corresponding code is generated. Typically, the corresponding code includes code automatically generated in response to particular controls and code added by a programmer. The window is created by the corresponding code. The window can then be presented to an end user.
Often a developer wishes to lay out a window which can be resized by the end user. It is also often desirable to provide controls in the window which will be resized or moved when the window is resized. For example, the window may contain text areas which should remain in the center of the window and change size as the size of the window changes size. When the window is made smaller, the text area should move to remain in the center of the smaller window. The text area should also reduce in size as the window is made smaller.
Conventional layout managers are a feature provided by some languages, such as Java. Some conventional form designers allow for the type and attributes of conventional layout managers to be set and generate the code used to create the conventional layout managers. A developer can then use the conventional layout manager to lay out a window which will be resized. The conventional layout managers define how the controls contained within the window will move when the window is resized. The conventional layout managers also typically define how the controls will be sized. Using these conventional layout managers, the developer can lay out a window which will automatically resize and move the controls within the window. Without the conventional layout manager, controls within the window are not moved or resized when the window is resized.
Although the conventional layout managers allow a developer to lay out a window having controls which will be moved or resized when the window is resized, a developer also typically wishes to have absolute discretion in the initial positioning and size of controls. This discretion allows a developer to easily obtain the desired look of the window. However, conventional layout managers are relatively inflexible. Conventional layout managers typically require a developer to place controls in specific portions of the window. Some conventional layout managers also automatically set the size of controls placed within the window. Thus, when using a conventional layout manager, a developer is restricted in how controls within a window are placed or sized.
In order to obtain more freedom initial placement and sizing controls, a developer might not use a conventional layout manager. However, if no layout manager is used, controls within the window are not moved or resized when the window is resized. A developer might also use a conventional layout manager that allows the developer more freedom in placement of controls. However, such conventional layout managers are typically complex to use.
Accordingly, what is needed is a more flexible system and method for laying out a window which will automatically resize or move controls when the window is resized. The present invention addresses such a need.
The present invention provides a method and system for providing a window capable of being resized. The window includes at least one control. In one aspect, the method and system include allowing a developer to place the at least one control in a desired position in the window and allowing a developer to set how the at least one control is to move upon resizing of the window. In the first aspect, the method and system further include moving the at least one control in accordance with how the developer has set the at least one control to be moved upon resizing of the window when the window is resized. In another aspect, the method and system include allowing a developer to place the at least one control in a desired position in the window and allowing the developer to set how the at least one control is to be resized upon resizing of the window. In this aspect, the method and system further include resizing the at least one control in accordance with how the developer has set the at least one control to be resized upon resizing of the window when the window is resized.
According to the system and method disclosed herein, the present invention provides more freedom to a developer while allowing controls to be resized or moved when a window is resized. Thus, relatively windows may be more easily laid out.